// WaveAnalysis.cpp : Implementation of CWaveAnalysisApp and DLL registration.

#include "stdafx.h"
#include "WaveAnalysis.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


CWaveAnalysisApp theApp;

const GUID CDECL BASED_CODE _tlid =
		{ 0xC996DC51, 0xFB66, 0x474C, { 0x87, 0x69, 0xE7, 0x5, 0xCD, 0x97, 0xA5, 0xB9 } };
const WORD _wVerMajor = 1;
const WORD _wVerMinor = 0;

ULONG_PTR           gdiplusToken;

// CWaveAnalysisApp::InitInstance - DLL initialization

BOOL CWaveAnalysisApp::InitInstance()
{
	BOOL bInit = COleControlModule::InitInstance();

	if (bInit)
	{
		// TODO: Add your own module initialization code here.
		GdiplusStartupInput gdiplusStartupInput;
		// Initialize GDI+.
		GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

	}

	return bInit;
}



// CWaveAnalysisApp::ExitInstance - DLL termination

int CWaveAnalysisApp::ExitInstance()
{
	// TODO: Add your own module termination code here.
	GdiplusShutdown(gdiplusToken);

	return COleControlModule::ExitInstance();
}



// DllRegisterServer - Adds entries to the system registry

STDAPI DllRegisterServer(void)
{
	AFX_MANAGE_STATE(_afxModuleAddrThis);

	if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
		return ResultFromScode(SELFREG_E_TYPELIB);

	if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
		return ResultFromScode(SELFREG_E_CLASS);

	return NOERROR;
}



// DllUnregisterServer - Removes entries from the system registry

STDAPI DllUnregisterServer(void)
{
	AFX_MANAGE_STATE(_afxModuleAddrThis);

	if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
		return ResultFromScode(SELFREG_E_TYPELIB);

	if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
		return ResultFromScode(SELFREG_E_CLASS);

	return NOERROR;
}
